import Vue from 'vue'
import VueRouter from 'vue-router'

import RandomDraw from "@/views/RandomDraw";
import WinRecord from "@/views/WinRecord";
import GiftDesc from "@/views/GiftDesc";
import Login from "@/views/Login";
import PrizeSetting from "@/views/PrizeSetting";
import UserView from "@/views/UserView";
import Register from "@/views/Register";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/Register',
    name: 'Register',
    component: Register
  },
  {
    path: '/PrizeSetting',
    name: 'PrizeSetting',
    component: PrizeSetting
  },

  {
    path: '/UserView',
    name: 'UserView',
    component: UserView,
    children: [
      {
        path: 'RandomDraw',
        name: 'RandomDraw',
        component: RandomDraw
      },
      {
        path: 'WinRecord',
        name: '抽奖记录',
        component: WinRecord
      },
      {
        path: 'GiftDesc',
        name: '奖品信息',
        component: GiftDesc
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
